import prisma from "./index.js";



export async function addComments(data) {
    return prisma.comment.create({
        data
    })
}


export async function findCommentsByLinkId(id) {
    return prisma.comment.findMany({
        where: {
            linkId: id
        }
    })
}

export async function addLike(id) {
    return prisma.comment.update({
        where: { id },
        data: {
            likes: {
                increment: 1
            }
        }
    })
}